﻿using ChurchDiary.BLL;
using ChurchDiary.TableEntity;
using ChurchWebsite.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;


namespace ChurchWebsite.Areas.Admin.Controllers
{
    public class ChurchWorkerMasterController : BaseController
    {
        //
        // GET: /Admin/ChurchWorkerMaster/

        public ActionResult Index()
        {
            return View();
        }
        
        #region Documents
        public ActionResult ChurchWorkersDocuments()
        {
            return View();
        }
        public ActionResult AddDocument(EntityDocuments Document)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.InsertDocument(Document), JsonRequestBehavior.AllowGet);
        }
        public ActionResult UpdateDocument(EntityDocuments Document)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.UpdateDocument(Document), JsonRequestBehavior.AllowGet);
        }
        public ActionResult DeleteDocument(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.DeleteDocument(dataId), JsonRequestBehavior.AllowGet);
        }
        public ActionResult GetDocuments(int PageNo, string SearchKey, string Sort, string SortMode)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetDocuments(PageNo, SearchKey, Sort, SortMode), JsonRequestBehavior.AllowGet);
        }
        public ActionResult GetDocumentsAll()
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetDocuments(), JsonRequestBehavior.AllowGet);
        }
        public ActionResult GetDocument(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetDocument(dataId), JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region RelationShip
        public ActionResult RelationShip()
        {
            return View();
        }
        public JsonResult AddRelationShip(EntityRelationShip RelationShip)
        {
            BLL_Shared CW = new BLL_Shared();
            return Json(CW.InsertRelationShip(RelationShip), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateRelationShip(EntityRelationShip RelationShip)
        {
            BLL_Shared CW = new BLL_Shared();
            return Json(CW.UpdateRelationShip(RelationShip), JsonRequestBehavior.AllowGet);
        }
        public JsonResult DeleteRelationShip(Guid dataId)
        {
            BLL_Shared CW = new BLL_Shared();
            return Json(CW.DeleteRelationShip(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetRelationShips(int PageNo, string SearchKey, string Sort, string SortMode)
        {
            BLL_Shared CW = new BLL_Shared();
            return Json(CW.GetAllRelationShips(PageNo, SearchKey, Sort, SortMode), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetRelationShip(Guid dataId)
        {
            BLL_Shared CW = new BLL_Shared();
            return Json(CW.GetRelationShipByID(dataId), JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region ChurchWorker Designation
        public ActionResult ChurchWorkerDesignation()
        {
            return View();
        }
        public JsonResult AddChurchWorkerDesignation(EntityChurchWorkerDesignation ChurchWorkerDesignation)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.InsertChurchWorkerDesignation(ChurchWorkerDesignation), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateChurchWorkerDesignation(EntityChurchWorkerDesignation ChurchWorkerDesignation)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.UpdateChurchWorkerDesignation(ChurchWorkerDesignation), JsonRequestBehavior.AllowGet);
        }
        public JsonResult DeleteChurchWorkerDesignation(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.DeleteChurchWorkerDesignation(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetChurchWorkerDesignations(int PageNo, string SearchKey, string Sort, string SortMode)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetChurchWorkerDesignation(PageNo,SearchKey,Sort,SortMode), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAllChurchWorkerDesignation()
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetChurchWorkerDesignation(), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetChurchWorkerDesignation(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetChurchWorkerDesignation(dataId), JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region Name Title
        public ActionResult NameTitle()
        {
            return View();
        }
        public JsonResult AddNameTitle(EntityNameTitle Name)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.InsertNameTitle(Name), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateNameTitle(EntityNameTitle Name)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.UpdateNameTitle(Name), JsonRequestBehavior.AllowGet);
        }
        public JsonResult DeleteNameTitle(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.DeleteNameTitle(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetNameTitles(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetNameTitle(PageNo, SearchKey, Sort, SortMode), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAllNameTitle()
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetNameTitle(), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetNameTitle(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetNameTitle(dataId), JsonRequestBehavior.AllowGet);
        }
        #endregion
        #region ChurchWorkerStatus
        public ActionResult ChurchWorkerStatus()
        {
            return View();
        }
        public JsonResult AddChurchWorkerStatus(EntityChurchWorkerStatus ChurchWorkerStatus)
        {
            return Json(new BLL_ChurchWorker().InsertChurchWorkerStatus(ChurchWorkerStatus), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateChurchWorkerStatus(EntityChurchWorkerStatus ChurchWorkerStatus)
        {
            return Json(new BLL_ChurchWorker().UpdateChurchWorkerStatus(ChurchWorkerStatus), JsonRequestBehavior.AllowGet);
        }

        public JsonResult DeleteChurchWorkerStatus(Guid dataId)
        {
            return Json(new BLL_ChurchWorker().DeleteChurchWorkerStatus(dataId), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetChurchWorkerStatuss(int PageNo, string SearchKey, string Sort, string SortMode, int PerPage)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetChurchWorkerStatus(PageNo, SearchKey, Sort, SortMode, PerPage), JsonRequestBehavior.AllowGet);
        }

        public JsonResult GetChurchWorkerStatus(Guid dataId)
        {
            BLL_ChurchWorker CW = new BLL_ChurchWorker();
            return Json(CW.GetChurchWorkerStatus(dataId), JsonRequestBehavior.AllowGet);
        }
        #endregion
    }
}
